Global Lighting Default Nvdbt
(global_lighting:default:NVDBT
, 0x9955407b2db0704f
)
This template is referenced 1 time by global_lighting.
Technique ambient
Render States
More info can be found on the Direct3D Docs
enum D3DRENDERSTATETYPE {
D3DRS_ZENABLE = 0,
D3DRS_ZFUNC = 4,
D3DRS_ZWRITEENABLE = 0,
D3DRS_ALPHABLENDENABLE = 0,
D3DRS_CULLMODE = 1,
D3DRS_COLORWRITEENABLE = 15,
D3DRS_COLORWRITEENABLE1 = 15,
D3DRS_COLORWRITEENABLE2 = 15,
D3DRS_STENCILENABLE = 1,
D3DRS_STENCILFUNC = 6,
D3DRS_STENCILFAIL = 1,
D3DRS_STENCILMASK = -1,
D3DRS_STENCILPASS = 1,
D3DRS_STENCILREF = 5,
D3DRS_STENCILWRITEMASK = 255,
D3DRS_STENCILZFAIL = 1,
D3DRS_DEPTHBIAS = 0,
D3DRS_SLOPESCALEDEPTHBIAS = 0,
D3DRS_FOGENABLE = 0,
D3DRS_SPECULARENABLE = 0,
D3DRS_ADAPTIVETESS_X = 0,
D3DRS_ADAPTIVETESS_Z = 0,
D3DRS_ADAPTIVETESS_W = 0,
D3DRS_SRGBWRITEENABLE = 0,
D3DRS_SEPARATEALPHABLENDENABLE = 0,
D3DRS_ALPHATESTENABLE = 0,
};
Sampler States
More info can be found on the Direct3D Docs
Sampler 0
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 1
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 2
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 3
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Shaders
Vertex Shader
column_major float4x4 camera_inv_view_matrix : register(vs_3_0, c4);
float3 camera_unprojection : register(vs_3_0, c7);
column_major float4x4 view_proj_matrix : register(vs_3_0, c0);
struct VertexMain_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
};
struct VertexMain_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
float3 texcoord1 : TEXCOORD1;
};
VertexMain_Output VertexMain(VertexMain_Input i)
{
VertexMain_Output o;
float2 temp0;
float3 temp1;
// def c8, 1, 0, 0, 0
// dcl_position v0
// dcl_texcoord v1
// dcl_position o0
// dcl_texcoord o1.xy
// dcl_texcoord1 o2.xyz
// dp4 o0.z, v0, c2
o.position.z = dot(i.position, (view_proj_matrix._m02_m12_m22_m32));
// dp4 o0.w, v0, c3
o.position.w = dot(i.position, (view_proj_matrix._m03_m13_m23_m33));
// dp4 r0.x, v0, c0
temp0.x = dot(i.position, (view_proj_matrix._m00_m10_m20_m30));
// dp4 r0.y, v0, c1
temp0.y = dot(i.position, (view_proj_matrix._m01_m11_m21_m31));
// mul r1.xy, r0, c7
temp1.xy = temp0.xy * camera_unprojection.xy;
// mov o0.xy, r0
o.position.xy = temp0.xy;
// mov r1.z, c8.x
temp1.z = float1(1);
// dp3 o2.x, r1, c4
o.texcoord1.x = dot(temp1.xyz, (camera_inv_view_matrix._m00_m10_m20_m30).xyz);
// dp3 o2.y, r1, c5
o.texcoord1.y = dot(temp1.xyz, (camera_inv_view_matrix._m01_m11_m21_m31).xyz);
// dp3 o2.z, r1, c6
o.texcoord1.z = dot(temp1.xyz, (camera_inv_view_matrix._m02_m12_m22_m32).xyz);
// mov o1.xy, v1
o.texcoord = i.texcoord;
//
return o;
}
Decompiled by DXDecompiler.
Pixel Shader
sampler2D albedo : register(ps_3_0, s0);
column_major float4x4 camera_world_matrix : register(ps_3_0, c0);
sampler2D depth : register(ps_3_0, s2);
sampler2D diffuse_texture : register(ps_3_0, s1);
float3 global_light_col : register(ps_3_0, c7);
float3 global_light_dir : register(ps_3_0, c6);
float3 ref_ambient_color : register(ps_3_0, c3);
float3 ref_fog_far_low_color : register(ps_3_0, c9);
float ref_fog_max_density : register(ps_3_0, c12);
float ref_fog_max_range : register(ps_3_0, c11);
float ref_fog_min_range : register(ps_3_0, c10);
float3 ref_fog_start_color : register(ps_3_0, c8);
float3 ref_sky_bottom_color : register(ps_3_0, c5);
float3 ref_sky_top_color : register(ps_3_0, c4);
sampler2D temp : register(ps_3_0, s3);
struct PixelMain_Input
{
float2 texcoord : TEXCOORD;
float3 texcoord1 : TEXCOORD1;
};
float4 PixelMain(PixelMain_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp2;
float3 temp1;
// def c13, -0.5, 2, 1, 0.5
// def c14, 200, 0.2, 0, 11.2
// def c15, 1.68, 0.05, 0.004, 0.5
// def c16, 0.06, -0.06666667, 0, 0
// dcl_texcoord v0.xy
// dcl_texcoord1 v1.xyz
// dcl_2d s0
// dcl_2d s1
// dcl_2d s2
// dcl_2d s3
// texld r0, v0, s2
temp0 = tex2D(depth, i.texcoord.xy);
// mov r1.x, c0.w
temp1.x = (camera_world_matrix._m00_m10_m20_m30).w;
// mov r1.y, c1.w
temp1.y = (camera_world_matrix._m01_m11_m21_m31).w;
// mov r1.z, c2.w
temp1.z = (camera_world_matrix._m02_m12_m22_m32).w;
// mad r0.yzw, v1.xxyz, r0.x, r1.xxyz
temp0.yzw = i.texcoord1.xyz * temp0.xxx + temp1.xyz;
// add r0.x, r0.x, -c10.x
temp0.x = temp0.x + -ref_fog_min_range.x;
// add r0.yzw, -r0, r1.xxyz
temp0.yzw = -temp0.yzw + temp1.xyz;
// nrm r1.xyz, r0.yzww
temp1.xyz = normalize(temp0.yzww.xyz).xyz;
// texld r2, v0, s1
temp2 = tex2D(diffuse_texture, i.texcoord.xy);
// add_pp r0.yzw, r2.xxyz, c13.x
temp0.yzw = /* not implemented _pp modifier */ temp2.xyz + float3(-0.5, -0.5, -0.5);
// add_pp r2.xyz, r0.yzww, r0.yzww
temp2.xyz = /* not implemented _pp modifier */ temp0.yzw + temp0.yzw;
// mad r0.y, r0.w, c13.y, c13.z
temp0.y = temp0.w * float1(2) + float1(1);
// dp3_sat r0.z, r2, r1
temp0.z = saturate(dot(temp2.xyz, temp1.xyz));
// dp3_sat r0.w, -c6, r2
temp0.w = saturate(dot(-global_light_dir.xyz, temp2.xyz));
// mad r1.x, r2.w, c14.x, c14.y
temp1.x = temp2.w * float1(200) + float1(0.2);
// pow r2.x, r0.z, r1.x
temp2.x = pow(temp0.z, temp1.x);
// mul r0.z, r2.w, r2.x
temp0.z = temp2.w * temp2.x;
// mad r1.x, r0.y, -c13.w, c13.z
temp1.x = temp0.y * float1(-0.5) + float1(1);
// mul r0.y, r0.y, c13.w
temp0.y = temp0.y * float1(0.5);
// mov r2.xyz, c5
temp2.xyz = ref_sky_bottom_color.xyz;
// mad r1.xyz, r2, r1.x, c3
temp1.xyz = temp2.xyz * temp1.xxx + ref_ambient_color.xyz;
// mad r1.xyz, c4, r0.y, r1
temp1.xyz = ref_sky_top_color.xyz * temp0.yyy + temp1.xyz;
// texld r2, v0, s3
temp2 = tex2D(temp, i.texcoord.xy);
// mul r0.y, r0.w, r2.w
temp0.y = temp0.w * temp2.w;
// mad r1.xyz, c7, r0.y, r1
temp1.xyz = global_light_col.xyz * temp0.yyy + temp1.xyz;
// mad r1.xyz, r2, c13.y, r1
temp1.xyz = temp2.xyz * float3(2, 2, 2) + temp1.xyz;
// mul r0.yzw, r0.z, r1.xxyz
temp0.yzw = temp0.zzz * temp1.xyz;
// texld r2, v0, s0
temp2 = tex2D(albedo, i.texcoord.xy);
// mad r0.yzw, r2.xxyz, r1.xxyz, r0
temp0.yzw = temp2.xyz * temp1.xyz + temp0.yzw;
// mad r1.xyz, r0.yzww, c15.x, c15.y
temp1.xyz = temp0.yzw * float3(1.68, 1.68, 1.68) + float3(0.05, 0.05, 0.05);
// mul r2.xyz, r0.yzww, c14.w
temp2.xyz = temp0.yzw * float3(11.2, 11.2, 11.2);
// mad r0.yzw, r0, c15.x, c15.w
temp0.yzw = temp0.yzw * float3(1.68, 1.68, 1.68) + float3(0.5, 0.5, 0.5);
// mad r0.yzw, r2.xxyz, r0, c16.x
temp0.yzw = temp2.xyz * temp0.yzw + float3(0.06, 0.06, 0.06);
// mad r1.xyz, r2, r1, c15.z
temp1.xyz = temp2.xyz * temp1.xyz + float3(0.004, 0.004, 0.004);
// rcp r2.x, r0.y
temp2.x = 1.0f / temp0.y;
// rcp r2.y, r0.z
temp2.y = 1.0f / temp0.z;
// rcp r2.z, r0.w
temp2.z = 1.0f / temp0.w;
// mad r0.yzw, r1.xxyz, r2.xxyz, c16.y
temp0.yzw = temp1.xyz * temp2.xyz + float3(-0.06666667, -0.06666667, -0.06666667);
// rcp r1.x, c11.x
temp1.x = 1.0f / ref_fog_max_range.x;
// mul r0.x, r0.x, r1.x
temp0.x = temp0.x * temp1.x;
// max r1.x, r0.x, c14.z
temp1.x = max(temp0.x, float1(0));
// min r0.x, c12.x, r1.x
temp0.x = min(ref_fog_max_density.x, temp1.x);
// add r0.x, -r0.x, c13.z
temp0.x = -temp0.x + float1(1);
// mul r0.x, r0.x, r0.x
temp0.x = temp0.x * temp0.x;
// mul r0.x, r0.x, r0.x
temp0.x = temp0.x * temp0.x;
// mov r1.xyz, c9
temp1.xyz = ref_fog_far_low_color.xyz;
// add r1.xyz, -r1, c8
temp1.xyz = -temp1.xyz + ref_fog_start_color.xyz;
// mad r1.xyz, r0.x, r1, c9
temp1.xyz = temp0.xxx * temp1.xyz + ref_fog_far_low_color.xyz;
// add r0.yzw, r0, -r1.xxyz
temp0.yzw = temp0.yzw + -temp1.xyz;
// mad oC0.xyz, r0.x, r0.yzww, r1
out_color.xyz = temp0.xxx * temp0.yzw + temp1.xyz;
// mov oC0.w, c14.z
out_color.w = float1(0);
//
return out_color;
}
Decompiled by DXDecompiler.